<template>
	<view class="content">
		<text>手机号</text>
		<input class="memberItIn" v-model="formData.telephone" />
		<view class="btMain">
			<button class="btOne" @click="getText()">粘贴手机号</button>
			<button class="btOne" @click="returnMain(0)">手机号登录</button>
		</view>
	</view>
</template>

<script>
	import config from '../../static/config.js'
	import util from '../../static/utils/util.js'
	export default {
		data() {
			return {
				images: config.images,
				localImages: config.localImages,
				formData: {
					"telephone": "18874183954",
					"roomIdNow": "22918",
					"openId": "onZpA5JuIaDlrDdaANOGGUcdo-g0",
					"roomId": "",
				},
			}
		},
		onLoad() {
			//在登录界面先获取下session信息，避免登录时，后台无法获取手机号
			this.getOpenId();
		},
		methods: {
			getText() {
				var self = this;
				wx.getClipboardData({
					success(res) {
						console.warn(res.data) // data
						self.formData.telephone = res.data;
					}
				})
			},
			returnMain(type = 0) {
				var phoneNumber = this.formData.telephone;
				wx.setStorageSync('phone', phoneNumber);
				wx.navigateTo({
					url: '/pages/index/select'
				})
			},
			
		},

	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		text-align: center;
		/* justify-content: center; */
	}

	.memberItIn {
		width: 500rpx;
		border: 1rpx solid;
	}

	.btMain {
		display: flex;
		flex-direction: row;
		margin-top: 10rpx;
	}

	.btOne {
		width: 300rpx;
		margin: 10rpx;
	}
</style>
